import 'package:flutter/material.dart';
import 'package:yurun_smartmerchants/res/colours.dart';
import 'package:yurun_smartmerchants/utils/app_size.dart';

class LoadingDialog extends Dialog{
  final String tip;

  LoadingDialog({this.tip});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Material(
      type: MaterialType.transparency,
      child: Center(
        child: Container(
          width: AppSize.width(270),
          height: AppSize.height(160),
          decoration: ShapeDecoration(
            color: Color(0xffffffff),
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(5)
                )
            ),
          ),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              CircularProgressIndicator(),
              tip == null ? Container() : Padding(
                padding: EdgeInsets.only(top: AppSize.height(20)),
                child: Text(tip,style: TextStyle(color: Colours.color_313131,fontSize: 14),),
              )

            ],
          ),
        ),
      )
    );
  }

}